package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LitemallConstantMapper;
import org.linlinjava.litemall.db.domain.LitemallConstant;
import org.linlinjava.litemall.db.domain.LitemallConstantExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LitemallConstantService {
    @Resource
    LitemallConstantMapper constantMapper;

    /**
     * @Description  获取全部常量
     * @Author Riko
     * @Date 2019/9/24
     **/
    public List<LitemallConstant> getAllConstant() {
        LitemallConstantExample example = new LitemallConstantExample();
        return constantMapper.selectByExample(example);
    }
    
    /**
     * @Description  根据id获取常量
     * @Author Riko
     * @Date 2019/9/24
     **/
    public LitemallConstant getConstantById(Integer id) {
        return constantMapper.selectByPrimaryKey(id);
    }
}
